﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AirLinq.Providers.Sql {
	public class SqlLike : SqlPredicate {
		private readonly SqlExpression _match;
		private readonly SqlExpression _pattern;
		private readonly SqlExpression _escape;
		public SqlLike(SqlExpression match, SqlExpression pattern, SqlExpression escape) {
			if (match == null) {
				throw new ArgumentNullException("match");
			}
			if (pattern == null) {
				throw new ArgumentNullException("pattern");
			}
			_match = match;
			_pattern = pattern;
			_escape = escape;
		}
		public SqlExpression Match {
			get {
				return _match;
			}
		}
		public SqlExpression Pattern {
			get {
				return _pattern;
			}
		}
		public SqlExpression Escape {
			get {
				return _escape;
			}
		}
		public override bool IsNotInjectionable {
			get { 
				return true; 
			}
		}
		public override SqlNodeType NodeType {
			get {
				return SqlNodeType.Like; 
			}
		}
	}
}
